/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author SHERLY
 */
@Entity
@Table(name = "cicloacademico")
@NamedQueries({
    @NamedQuery(name = "Cicloacademico.findAll", query = "SELECT c FROM Cicloacademico c"),
    @NamedQuery(name = "Cicloacademico.findByNCicAcdId", query = "SELECT c FROM Cicloacademico c WHERE c.nCicAcdId = :nCicAcdId"),
    @NamedQuery(name = "Cicloacademico.findByVNombre", query = "SELECT c FROM Cicloacademico c WHERE c.vNombre = :vNombre"),
    @NamedQuery(name = "Cicloacademico.findByVNemonico", query = "SELECT c FROM Cicloacademico c WHERE c.vNemonico = :vNemonico"),
    @NamedQuery(name = "Cicloacademico.findByVEstado", query = "SELECT c FROM Cicloacademico c WHERE c.vEstado = :vEstado")})
public class Cicloacademico implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "nCicAcdId")
    private Integer nCicAcdId;
    @Size(max = 60)
    @Column(name = "vNombre")
    private String vNombre;
    @Size(max = 10)
    @Column(name = "vNemonico")
    private String vNemonico;
    @Size(max = 1)
    @Column(name = "vEstado")
    private String vEstado;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nCicAcdId")
    private List<Asignatura> asignaturaList;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "cicloacademico")
    private Cicloxperiodo cicloxperiodo;

    public Cicloacademico() {
    }

    public Cicloacademico(Integer nCicAcdId) {
        this.nCicAcdId = nCicAcdId;
    }

    public Integer getNCicAcdId() {
        return nCicAcdId;
    }

    public void setNCicAcdId(Integer nCicAcdId) {
        this.nCicAcdId = nCicAcdId;
    }

    public String getVNombre() {
        return vNombre;
    }

    public void setVNombre(String vNombre) {
        this.vNombre = vNombre;
    }

    public String getVNemonico() {
        return vNemonico;
    }

    public void setVNemonico(String vNemonico) {
        this.vNemonico = vNemonico;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public List<Asignatura> getAsignaturaList() {
        return asignaturaList;
    }

    public void setAsignaturaList(List<Asignatura> asignaturaList) {
        this.asignaturaList = asignaturaList;
    }
    
    public Cicloxperiodo getCicloxperiodo() {
        return cicloxperiodo;
    }

    public void setCicloxperiodo(Cicloxperiodo cicloxperiodo) {
        this.cicloxperiodo = cicloxperiodo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nCicAcdId != null ? nCicAcdId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cicloacademico)) {
            return false;
        }
        Cicloacademico other = (Cicloacademico) object;
        if ((this.nCicAcdId == null && other.nCicAcdId != null) || (this.nCicAcdId != null && !this.nCicAcdId.equals(other.nCicAcdId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return vNemonico;
    }
    
}
